home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / size.z / size
Text File  |  1998-10-30  |  10KB  |  265 lines

  1.  
  2.  
  3.  
  4. SSSSIIIIZZZZEEEE((((1111))))                                                                SSSSIIIIZZZZEEEE((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      size - print the section sizes of object files
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ssssiiiizzzzeeee [ ----dddd ----ffff ----nnnn ----oooo ----4444 ----ssssvvvvrrrr4444 ----xxxx ----AAAA ----BBBB ----FFFF ----VVVV ] files
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The _s_i_z_e command prints segment or section information in bytes about the
  16.      various sections or segments of each named ELF object _f_i_l_e.  Each _f_i_l_e
  17.      can be an object or an archive.
  18.  
  19.      When calculating segment information, the _s_i_z_e command prints out the
  20.      total file size of the non-writable segments, the total file size of the
  21.      writable segments, and the total memory size minus the total file size of
  22.      the writable segments.
  23.  
  24.      If it cannot find segment information, _s_i_z_e calculates based on section
  25.      information.  When calculating based on section information, it
  26.      calculates the total size of sections that are allocatable, non-writable
  27.      and not NOBITS; the total size of the sections that are allocatable,
  28.      writable, and not NOBITS; and the total size of the writable sections of
  29.      type NOBITS (NOBITS sections do not actually take up space in the _f_i_l_e.)
  30.      Among the sections which may be mentioned and counted are:  ._t_e_x_t, ._i_n_i_t,
  31.      ._r_d_a_t_a, ._d_a_t_a, ._s_d_a_t_a, ._s_b_s_s, ._d_y_n_s_y_m, ._d_s_o_l_i_s_t, ._c_o_n_f_l_i_c_t, and ._l_c_l_d_t_a.
  32.      Some of the sections marked allocatable, for example ._s_t_r_t_a_b and ._s_y_m_t_a_b
  33.      may be a surprise, since they don't seem as if they would be loaded at
  34.      run time.  However, some of this information does get into symbol tables
  35.      which, for shared-code (PIC) are in memory at run time so _r_l_d(1) can use
  36.      them.
  37.  
  38.      By default, the output format is that of AT&T System V Release 3 showing
  39.      sections (not segments) as described above followed by System V Release
  40.      4-style totals.
  41.  
  42.      _s_i_z_e supports the following options:
  43.  
  44.      ----dddd   Print the sizes in decimal.
  45.  
  46.      ----ffff   Prints out the size of each allocatable section, the name of the
  47.           section, and the total of the section sizes.  If there is no section
  48.           data, _s_i_z_e prints out an error message and stops processing the
  49.           file.  Segment information is ignored: only section information is
  50.           used.
  51.  
  52.      ----nnnn   Prints out non-loadable segment or non-allocatable section sizes.
  53.           If segment data exists, _s_i_z_e prints out the memory size of each
  54.           loadable segment or file size of each non-loadable segment, the
  55.           permission flags, and the total size of the segments.  If there is
  56.           no segment data, _s_i_z_e prints out, for each allocatable and non-
  57.           allocatable section, the memory size, the section name, and the
  58.           total size of the sections.  If there is no segment or section data,
  59.           _s_i_z_e prints an error message and stops processing.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSIIIIZZZZEEEE((((1111))))                                                                SSSSIIIIZZZZEEEE((((1111))))
  71.  
  72.  
  73.  
  74.      ----oooo   Print the sizes in octal.
  75.  
  76.      ----4444   Suppress detailed listings, leaving just the AT&T System V Release 4
  77.           summary output.  If segment information is present, print it rather
  78.           than section information (unless ----ffff is also present).
  79.  
  80.      ----ssssvvvvrrrr4444
  81.           The same as -4, but deprecated as multi-letter options are not
  82.           appropriate under System V Release 4 option guidelines.
  83.  
  84.      ----xxxx   Print the sizes in hexadecimal.
  85.  
  86.      ----AAAA   Use AT&T System V Release 3-style output.  This is the default
  87.           style.  This style is more verbose than the ----4444 output; each section
  88.           is printed with both size and physical and virtual addresses.  It is
  89.           followed by the System V Release 4-style totals.  Segment
  90.           information is ignored: only section information is used.
  91.  
  92.      ----BBBB   Use Berkeley-style (4.3BSD) output.  This style prints size
  93.           information for each section, regardless of whether the file exists,
  94.           and prints the total in both hexadecimal and decimal.  The _t_e_x_t and
  95.           _d_a_t_a section sizes reported may be rounded to page sizes.  In the
  96.           rounding (done by _l_d(1)) some _b_s_s may be moved into _d_a_t_a. The
  97.           numbers reported are the actual numbers used to load the program
  98.           into memory.  Only sections named ._t_e_x_t, ._i_n_i_t or ._f_i_n_i are counted
  99.           as text.  Segment information is ignored: only section information
  100.           is used.
  101.  
  102.      ----FFFF   Prints out the size of each loadable segment, the permission flags
  103.           of the segment, then the total of the loadable segment sizes.  If
  104.           there is no segment data, _s_i_z_e prints an error and stops processing
  105.           the file.
  106.  
  107.      ----VVVV   Print the version of _s_i_z_e on standard error.
  108.  
  109. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  110.      The examples below show typical _s_i_z_e output.
  111.  
  112.       size -4  _f_i_l_e
  113.  
  114.       90112 + 12288 + 0 = 102400
  115.  
  116.  
  117.       size -svr4 -f  _f_i_l_e
  118.  
  119.       _1_9(._i_n_t_e_r_p) + _2_4(._r_e_g_i_n_f_o) + _1_9_2(._d_y_n_a_m_i_c) + _3_2(._l_i_b_l_i_s_t) + _1_2_0_0(._m_s_y_m)
  120.      + _1_6_0_0(._d_y_n_s_t_r) + _2_3_8_4(._d_y_n_s_y_m) + _1_6_3_2(._h_a_s_h) + _8_2_5_6_0(._t_e_x_t) + _3_2(._i_n_i_t)
  121.      + _1_4_7_2(._d_a_t_a) + _8_0_0_0(._r_o_d_a_t_a) + _4_6_4(._g_o_t) + _4_8(._b_s_s) = _9_9_6_5_9
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSIIIIZZZZEEEE((((1111))))                                                                SSSSIIIIZZZZEEEE((((1111))))
  137.  
  138.  
  139.  
  140.       size -4 -F  _f_i_l_e
  141.  
  142.       _9_0_1_1_2(_r-_x) + _1_2_2_8_8(_r_w-) = _1_0_9_4_8_3
  143.  
  144. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  145.      a.out (4)
  146.      System V Application Binary Interface
  147.        Pub by Prentice Hall,
  148.        ISBN 0-13-877598-2
  149.      System V Application Binary Interface MIPS
  150.        Processor Supplement
  151.        Pub by Prentice Hall,
  152.        ISBN 0-13-880170-3
  153.      MIPSpro Assembly Language Programmer's Guide
  154.      /usr/include/elf.h
  155.      /usr/include/sys/elf.h
  156.  
  157. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  158.      _s_i_z_e cannot calculate either segment or section information, it prints an
  159.      error message and stops processing the file.
  160.  
  161. NNNNOOOOTTTTEEEESSSS
  162.      Since the size of ._b_s_s sections is not known until link-time, _s_i_z_e will
  163.      not give the true total size of pre-linked objects.
  164.  
  165.      The rounding shown by the ----BBBB option can have effects that may surprise:
  166.      reducing the size of data a small amount can result in some _b_s_s space
  167.      being moved from the rounded _d_a_t_a back into _b_s_s and make _b_s_s appear to
  168.      grow.
  169.  
  170.      Some sections are shown and counted as data with the ----BBBB option that might
  171.      be considered text in some sense.  For example, the ....rrrrooooddddaaaattttaaaa section is
  172.      counted as data even if it is part of the shared text program header
  173.      segment.
  174.  
  175.      The ----BBBB option interacts strangely with other options such as ----nnnn aaaannnndddd ----ffff
  176.      making the output useless.
  177.  
  178.      The last of ----ssssvvvvrrrr4444, ----4444,,,, ----AAAA, and ----BBBB is the option applied if more than one
  179.      is supplied.
  180.  
  181.      For executables, arguably size -4 a.out is more accurate than size -B
  182.      a.out since the former reports totals of precisely what the kernel must
  183.      load (using segment information) whereas the latter reports  how the
  184.      sections describe the a.out  but counting only the text as text, not
  185.      counting ._d_y_n_s_y_m etc.  On the other hand, the ----BBBB format does directly
  186.      describe the executable instructions (leaving out read-only tables) so
  187.      for some purposes it may be more useful.
  188.  
  189.      Section names given above are mostly described in the Application Binary
  190.      Interface books mentioned in the SEE ALSO section above.  In addition,
  191.      some sections are described in the MIPSpro Assembly Language Programmers
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSIIIIZZZZEEEE((((1111))))                                                                SSSSIIIIZZZZEEEE((((1111))))
  203.  
  204.  
  205.  
  206.      Guide (mentioned above).
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.